import request from "@/utils/request";
import { AxiosPromise } from "axios";

/**
 * 客服登记表数据
 *
 * @param queryParams
 */
export function getSysClientRegisterPage(queryParams: any): AxiosPromise<PageResult<[]>> {
	return request({
		url: '/api/v1/clientRegister/page',
		method: 'get',
		params: queryParams
	});
}

/**
 * 删除客服登记表
 *
 * @param ids
 */
export function deleteSysClientRegister(ids: string) {
	return request({
		url: '/api/v1/clientRegister/' + ids,
		method: 'delete'
	});
}

/**
 * 导入客服登记表
 *
 * @param file
 */
export function importSysClientRegister(file: any) {
	const formData = new FormData();
	formData.append('file', file);
	return request({
		url: '/api/v1/clientRegister/sysClientRegisterImport',
		method: 'post',
		data: formData,
		headers: {
			'Content-Type': 'multipart/form-data'
		}
	});
}

/**
 * 导出客服登记表
 *
 * @param ids
 * @returns
 */
export function exportSysClientRegister(ids: any) {
	return request({
		url: '/api/v1/clientRegister/_export?ids='+ids,
		method: 'get',
		responseType: 'arraybuffer'
	});
}

/**
 * 根据订单号查询
 *
 * @param orderNo
 * @returns
 */
export function getByOrderNo(orderNo: any) {
	return request({
		url: '/api/v1/clientRegister/getByOrderNo/'+orderNo,
		method: 'get',
	});
}
